<#import "/ftl/mainAdmin.ftl" as page>

<@page.mainTemplate styleSheet="tenantCss" jsFile="tenanteditJs" current="商户信息">
    <div class="page-content">
        <!-- BEGIN PAGE HEAD-->
        <div class="page-head">
            <!-- BEGIN PAGE TITLE -->
                <div class="page-title">
                    <h1>新增商户
                        <small>新增商户页面</small>
                    </h1>

                </div>
            <!-- END PAGE TITLE -->
        </div>
        <!-- END PAGE HEAD -->
        <!-- BEGIN PAGE BREADCRUMB -->
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <a href="${context}/base/index_ftl">首页</a>
                <i class="fa fa-circle"></i>
            </li>
            <li>
                <span class="active">新增商户</span>
            </li>
        </ul>
        <!-- END PAGE BREADCRUMB -->
        <!-- BEGIN PAGE BASE CONTENT -->
        <div class="portlet light bordered">
            <div class="portlet-body form">
                <form class="createform" role="form" action="javascript:;" method="POST" id="createForm">
                    <input type="hidden" id="id" name="id" class="form-control" value="${businessVO.id}"   />
                    <input type="hidden" id="bank_id" name="bank.id" class="form-control" value="<#if businessVO.bank ?? >${businessVO.bank.id}</#if>"   />
                   
                    <div class="form-body">
                        <div class="alert alert-danger display-hide">
                            <button class="close" data-close="alert"></button> 表单含有错误. 请检查. 
                        </div>
                        <div class="alert alert-success display-hide">
                            <button class="close" data-close="alert"></button> 表单验证通过! 
                        </div>
                        <div class="row">
                        	<div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">商家名称</label>
				                        <div class="input-group-content">
				                            <input type="text" id="business_name" name="business_name" class="form-control" 
				                            placeholder="★商家名称" value="${businessVO.business_name}"   />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
		                        <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">商家标识</label>
				                        <div class="input-group-content">
				                            <input type="text" id="business_mark" name="business_mark" 
				                            class="form-control" placeholder="★商家标识" value="${businessVO.business_mark}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        <div class="row">
                            
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">商家公钥</label>
				                        <div class="input-group-content">
				                            <input type="text" id="business_key" name="business_key" 
				                            class="form-control" placeholder="★商家公钥" value="${businessVO.business_key}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
		                        <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">组织机构代码</label>
				                        <div class="input-group-content">
				                            <input type="text" id="org_code" name="org_code" 
				                            class="form-control" placeholder="★组织机构代码" value="${businessVO.org_code}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				         <div class="row">
                            
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">上玄公钥</label>
				                        <div class="input-group-content">
				                            <input type="text" id="public_key" name="public_key" 
				                            class="form-control" placeholder="★上玄公钥" value="${businessVO.public_key}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
		                        <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">上玄私钥</label>
				                        <div class="input-group-content">
				                            <input type="text" id="private_key" name="private_key" 
				                            class="form-control" placeholder="★上玄私钥" value="${businessVO.private_key}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        <div class="row">
                            
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">法人</label>
				                        <div class="input-group-content">
				                            <input type="text" id="business_legal" name="business_legal"  class="form-control" 
				                            placeholder="★法人" value="${businessVO.business_legal}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">证件类型</label>
				                        <div class="input-group-content">
				                            <select name="papers_type" class="form-control input-inline">
				                            			<option value="IDENTITYCARD" <#if businessVO.papers_type='IDENTITYCARD' > selected </#if>   >身份证</option>
					                                   <option value="OFFICER"  <#if businessVO.papers_type='OFFICER' > selected </#if>   >军官证</option>
					                                    <option value="POLICE"   <#if businessVO.papers_type='POLICE' > selected </#if>  >军官证,警官证</option>
					                                    <option value="HOUSEHOLD"  <#if businessVO.papers_type='HOUSEHOLD' > selected </#if>   >户口本</option>
					                                    <option value="PASSPORT"   <#if businessVO.papers_type='PASSPORT' > selected </#if>  >护照</option>
					                                    <option value="TEMPORARY"  <#if businessVO.papers_type='TEMPORARY' > selected </#if>   >临时证件</option>
					                                    <option value="OTHER"  <#if businessVO.papers_type='OTHER' > selected </#if>   >其它</option>
											</select>
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        
				        <div class="row">
				        	
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">证件号码</label>
				                        <div class="input-group-content">
				                            <input type="text" id="papers_num" name="papers_num" class="form-control" placeholder="证件号码" 
				                            value="${businessVO.papers_num}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">状态</label>
				                        <div class="input-group-content">
				                            <select name="status" class="form-control input-inline">
				                               <option value="${businessVO.status}" selected>${businessVO.status_str}</option>
											</select>
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        <div class="row">
				        	<div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">开始时间</label>
				                        <div class="input-group-content">
					                                       <!-- <input type="text" id="start_time" name="start_time" class="form-control" placeholder="开始时间" value="" />
					                                       -->
				                           					 <div class="input-group date date-picker" data-date-format="dd-mm-yyyy" >
					                                        <input type="text" class="form-control"  id="start-time" name="start_time" value="${businessVO.start_time_str}">
					                                        <span class="input-group-btn">
					                                            <button class="btn default" type="button">
					                                                <i class="fa fa-calendar"></i>
					                                            </button>
					                                        </span>
					                                    </div>
					                                </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">结束时间</label>
				                        <div class="input-group-content">
				                           					<div class="input-group date date-picker" data-date-format="dd-mm-yyyy" >
					                                        <input type="text" class="form-control" value="${businessVO.end_time_str}" id="end-time" name="end_time">
					                                        <span class="input-group-btn">
					                                            <button class="btn default" type="button">
					                                                <i class="fa fa-calendar"></i>
					                                            </button>
					                                        </span>
					                                    </div>
					                                </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        <div class="row">
				        	<div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">IP地址</label>
				                        <div class="input-group-content">
				                            <input type="text" id="business_ip" name="business_ip" class="form-control" placeholder="IP地址" 
				                            value="${businessVO.business_ip}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">商家地址</label>
				                        <div class="input-group-content">
				                            <input type="text" id="business_address" name="business_address" class="form-control" placeholder="商家地址" 
				                            value="${businessVO.business_address}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        
				        <div class="row">
				        	
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">联系人</label>
				                        <div class="input-group-content">
				                            <input type="text" id="business_contacts" name="business_contacts" class="form-control" placeholder="联系人" 
				                            value="${businessVO.business_contacts}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">联系人手机号</label>
				                        <div class="input-group-content">
				                            <input type="text" id="contacts_phone" name="contacts_phone" class="form-control" placeholder="联系人手机号" 
				                            value="${businessVO.contacts_phone}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        
				        <div class="row">
				        	
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">邮箱</label>
				                        <div class="input-group-content">
				                            <input type="text" id="email" name="email" class="form-control" placeholder="邮箱" 
				                            value="${businessVO.email}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">开户人名称</label>
				                        <div class="input-group-content">
				                           <input type="text" id="bank_consumer_name" name="bank.bank_consumer_name" class="form-control" placeholder="开户人名称" 
					                            value="<#if businessVO.bank ?? >${businessVO.bank.bank_consumer_name} </#if>" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        <div class="row">
				        	
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">开户账号</label>
				                        <div class="input-group-content">
				                             <input type="text" id="account_no" name="bank.card_num" class="form-control" placeholder="开户账号" 
				                            value="<#if businessVO.bank ?? >${businessVO.bank.card_num}</#if>" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				            <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">开户行名称</label>
                                            <div class="input-group-content">
		                                            <input type="hidden" id="cls_bank_name" name="bank.cls_bank_name" class="form-control" data-code='<#if businessVO.bank ?? >${businessVO.bank.cls_bank_code}</#if>'
		                                            value="<#if businessVO.bank ?? >${businessVO.bank.bank_consumer_name}</#if>" />
		                                                <select id="cls_bank_code" name="bank.cls_bank_code"  class="form-control input-inline">
		                                                    <option  value="<#if businessVO.bank ?? >${businessVO.bank.cls_bank_code}</#if>" ><#if businessVO.bank ?? >${businessVO.bank.cls_bank_name}</#if></option>
		                                                </select>
                                                 
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
				        </div>
				        <div class="row">
                                  
                                <div class="col-md-6">
                                        <div class="form-group">
                                            <div class="input-group">
                                                <label class="input-group-addon">开户支行省市</label>
                                                <input type="hidden" class="form-control" id="province_name" value="<#if businessVO.bank ?? >${businessVO.bank.city_info.up_city_po.city_name}</#if>"
                                                data-code='<#if businessVO.bank ?? >${businessVO.bank.city_info.up_city_po.id}</#if>' >
                                           		<input type="hidden" id="city_name" class="form-control"  value="<#if businessVO.bank ?? >${businessVO.bank.city_info.city_name}</#if>" 
                                           		data-code='<#if businessVO.bank ?? >${businessVO.bank.city_info.id}</#if>'>
                                           		<div class="input-group-content">
	                                                <div class="col-md-6 plr0">
	                                                    <select  id="province_code"  name="bank.province_code" readonly="readonly" class="form-control input-inline">
	                                                     <option value="${businessVO.bank.city_info.up_city_po.id}" selected>${businessVO.bank.city_info.up_city_po.city_name}</option>
	                                                    </select>
	                                                </div>
	                                                <div class="col-md-6 plr0">
	                                                	<select  id="city_code"  name="bank.city_id" readonly="readonly" class="form-control input-inline">
	                                                     <option value="${businessVO.bank.city_info.id}" selected>${businessVO.bank.city_info.city_name}</option>
	                                                    </select>
	                                                </div>
	                                            </div> 
                                            </div>
                                        </div>
                                    </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">开户行支名称</label>
                                            <div class="input-group-content">
                                                <input name="bank.brank_bank_name" id="brank_bank_name" type="hidden" value="${businessVO.bank.bank_info.bank_name}" data-code="${businessVO.bank.bank_info.id}" />
                                                <select id="brank_bank_code" name="bank.bank_id"  class="form-control input-inline">
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                
                                <!--/span-->
                            </div>
				        <div class="row">
				         
				            <div class="col-md-6">
				                <div class="form-group">
				                    <div class="input-group">
				                        <label class="input-group-addon">备注</label>
				                        <div class="input-group-content">
				                            <input type="text" id="remark" name="remark" class="form-control" placeholder="备注" 
				                            value="${businessVO.remark}" />
				                        </div>
				                    </div>
				                </div>
				            </div>
				        </div>
				        
		                <div class="form-actions top">
		                    <div class="row col-md-4 col-xs-4 col-md-offset-5">
		                    	<button type="submit" id="btnSubmit" class="btn green">保存</button>
                                <a href="${context}/businessInfo/businessIndex" class="btn default">返回</a>
		                    </div>
		                </div>
		            </div>
                </form>
            </div>
        </div>
        <!-- END PAGE BASE CONTENT -->
    </div>
</@page.mainTemplate>